<template>
	<view class="searchBox">
		<u-search :placeholder="placeholder" @clear="clear" v-model="text" :showAction="false" :clearabled="false" @blur="inputBlur" @search="enter" @change="textChange">
		</u-search>
		<!-- <record class="img" @setText="getText"></record> -->
	</view>
</template>
<script>
	export default {
		props:{
			placeholder: {
				type: String,
				default: () => '请输入关键字'
			}
		},
		data() {
			return {
				text: undefined
			}
		},
		methods: {
			textChange(val){
				this.$emit('change',val)
			},
			getText(text){
				this.text=text
			},
			inputBlur(value) {
				this.$emit("input", value)
			},
			enter(val){
				this.$emit('enter',val)
			},
			clear(){
				this.$emit('clear')
			},
		}
	}
</script>

<style scoped>
	.searchBox {
		width: 100%;
		position: relative;
		padding-bottom: 20rpx;
	}

	.searchBox .img {
		position: absolute;
		top: 10rpx;
		right: 20rpx;
		z-index: 9;
	}
</style>
